package com.xps.charminguser.date.net;

import android.support.annotation.Nullable;
import android.util.Log;


import com.xps.charminguser.utils.SharedPreferencesUtils;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;


public class LoggingInterceptor implements Interceptor {

    @Override
    public Response intercept(@Nullable Chain chain) throws IOException {
        Request request = chain.request();
        Request.Builder builder = request.newBuilder();
        String user_token = SharedPreferencesUtils.getString("user_token", "String", null);
        builder.url(request.url().toString() + "?tokens=" + user_token);
        Log.e("user_token",request.url().toString() + "?tokens=" + user_token);
        return chain.proceed(builder.build());
    }
}
